<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/13 0013 19:29
 */


//这是其他类型文件编辑页面，

$content=str_replace("/","\\",$_GET['content']);
$file_path = __DIR__.'\\'.$content;
$file_pathnew=iconv( "utf-8","gb2312", $file_path);
?>


<html>
<form action="template-edit-submit.php"  method="post">
    <input type="hidden"  name="file" value="<?= $file_path?>"/>
    <textarea  rows="20" cols="200" name="content">
    <?php

    if(file_exists($file_pathnew)) {
        $str = file_get_contents($file_pathnew);//将整个文件内容读入到一个字符串中
//    $str = str_replace("\r\n","<br />",$str);
        echo $str;
    }
    ?>
</textarea>
    <input type="submit"/>
</form>


</html>